﻿using CoreWeb.Utility.Filter;
using Microsoft.AspNetCore.Mvc;

namespace CoreWeb.Controllers
{
    //[CustomExpeptionFilterAttribute]   针对于这个类下的报错处理  ---AOP
    public class FourthController : Controller
    {
        //[CustomExpeptionFilterAttribute]   针对于这个方法下的报错处理  ---AOP
        public IActionResult Index()
        {
            int i = 1;
            int k = 3;
            int m = i + k;//业务逻辑
            int l = m - m;
            int j= m / l; //来个异常
            return View();
        }
        public IActionResult Info()
        {
            int i = 1;
            int k = 3;
            int m = i + k;//业务逻辑
            int l = m - m;
            int j = m / l;
            return View();
        }
        [CustomActionFilter]
        public IActionResult Infomation()
        {
            Console.WriteLine("this is Infomation action");
            return View();
        }
    }
}
